#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
#include<string.h>

int main(int argc,char **argv)
{
    if (argc < 2)
    {
        fprintf(stderr,"Usage ... \n");
        exit(1);
    }
    
    FILE *fp;
    char *bufline = NULL;
    size_t bufsize = 0;

    fp = fopen(argv[1],"r");
    if (fp == NULL)
    {
        perror("fopen");
        exit(1);
    }

    while (getline(&bufline,&bufsize,fp)>=0)
    {
        printf("%d\n",strlen(bufline));
        printf("%d\n",bufsize);
    }
    
    fclose(fp);

    exit(0);
    
}